/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package etherblocks.mods.survival;

import com.jme3.network.serializing.Serializer;
import etherblocks.engine.network.GameServer;
import etherblocks.mods.Mod;
import etherblocks.mods.survival.entitysystem.components.*;
import etherblocks.mods.survival.entitysystem.systems.*;
import etherblocks.mods.survival.gui.*;
import etherblocks.mods.survival.messages.*;

/**
 *
 * @author Philipp
 */
public class SurvivalMod extends Mod
{

    public SurvivalMod() {
        super("Survival");
        properties.setValue("isBlockTerrainEditable", false);
        properties.setValue("isItemBarVisible", false);
        //properties.setValue("isCameraChangable", false);
        //properties.setValue("isRespawnAllowed", false);
    }
    
    static
    {
        Serializer.registerClasses(
            //Messages
            Message_EatCommand.class,
            Message_HealCommand.class,
            //Components
            AggroComponent.class,
            CanBeAttackedComponent.class,
            HasTargetComponent.class,
            HealthComponent.class,
            HungerComponent.class
        );
    }
    @Override
    public void onGameStarted(){
        super.onGameStarted();
        addNifty("Interface/mods/survival/IngameMenu.xml");
        ScreenController_IngameMenu screenController_IngameMenu = getScreenController(ScreenController_IngameMenu.class);
        screenController_IngameMenu.setNetworkClient(getNetworkClient());
        addEntitySystem(new DisplaySystem(getPlayerEntityID(), screenController_IngameMenu));
    }

    @Override
    public GameServer createGameServer(){
        return new SurvivalGameServer();
    }
}
